﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace TestByWire
{
	public class ThenWithTarget<T> : Then
	{
		public void TargetFulfills(Func<T, bool> func)
		{
			AssertDoubleInvocations();
			var result = func.Invoke((T)Target);
			if (!result)
				throw new AssertFailedException("Expected true, but was false.");
		}
	}
}